<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>天书榜 | 作者管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/png" sizes="32x32" href="icon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="icon/favicon-16x16.png">
    <link rel="stylesheet" href="admin/plugins/fontawesome-free/css/all.min.css">
    <link rel="stylesheet" href="css/ionicons/2.0.1/ionicons.min.css">
    <link rel="stylesheet" href="admin/plugins/datatables-bs4/css/dataTables.bootstrap4.css">
    <link rel="stylesheet" href="admin/css/adminlte.min.css">
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
    <nav class="main-header navbar navbar-expand navbar-white navbar-light">
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
            </li>
        </ul>
        <ul class="navbar-nav ml-auto">
            <li class="nav-item dropdown">
                <a class="nav-link" data-toggle="dropdown" href="#">
                    <i class="far fa-user text-gray"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                    <div class="dropdown-divider"></div>
                    <a href="javascript:void(0);" class="dropdown-item" onclick="logout();">
                        <i class="fas fa-sign-out-alt mr-2"></i>登出
                    </a>
                </div>
            </li>
        </ul>
    </nav>

    <#include "./sideMenu.ftl">

    <div class="content-wrapper">
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>作者管理</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="#">主页</a></li>
                            <li class="breadcrumb-item active">作者管理</li>
                        </ol>
                    </div>
                </div>
            </div>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <table>
                                <tbody>
                                <td>
                                    <button type="button" class="btn btn-block btn-primary" onclick="onAuthorListAddAuthorButtonClick();">新增</button>
                                </td>
                                <td>
                                    <button type="button" class="btn btn-block btn-danger" disabled>全部删除</button>
                                </td>
                                </tbody>
                            </table>
                        </div>
                        <div class="card-body">
                            <table id="author-table-container" class="table table-bordered table-striped table-hover">
                                <thead>
                                <tr>
                                    <td>名字</td>
                                    <td>创建时间</td>
                                    <td>操作</td>
                                </tr>
                                </thead>
                                <tbody>
                                    <#list contentList as row>
                                        <tr cid="${row[0]}">
                                            <td>${row[1]}</td>
                                            <td>${row[2]}</td>
                                            <td>
                                                <button class="btn btn-warning" onclick="onAuthorListUpdateAuthor(this);"><i class="fas fa-edit mr-2"></i>修改</button>
                                                <button class="btn btn-danger" onclick="onAuthorListDeleteAuthor(this);" disabled><i class="far fa-trash-alt mr-2"></i>删除</button>
                                            </td>
                                        </tr>
                                    </#list>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <footer class="main-footer">
        <span> &copy; ${year2year} <strong><a href="http://tianshubang.com">tianshubang.com</a></strong> 版权所有 (v 1.0.1)</span>
        <span class="ml-2 mr-2 text-gray">|</span>
        <a href="/articlerepository"><u class="text-gray">小说索引</u></a>
        <span class="ml-2 mr-2 text-gray">|</span>
        <a href="/authorrepository"><u class="text-gray">作者索引</u></a>
    </footer>
</div>

<script src="admin/plugins/jquery/jquery.min.js"></script>
<script src="admin/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="admin/plugins/datatables/jquery.dataTables.js"></script>
<script src="admin/plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
<script src="admin/js/adminlte.min.js"></script>
<script src="utility.js"></script>
<script src="script/page/authorlist.js"></script>
<script>
    $(function () {
        $("#author-table-container").DataTable({
            "paging": true,         //是否分页，如果是false，则全部显示，否则默认是10个数据一页
            "lengthChange": true,   //是否可以控制每页多少个数据，这个会影响Show x entries的显示
            "searching": true,      //是否要显示search栏
            "ordering": true,       //是否出排序的小控件
            "info": true,           //不知
            "autoWidth": false,     //
            "language": {
                "lengthMenu": "每页显示记录 _MENU_",
                "zeroRecords": "没有任何内容",
                "info": "当前第_PAGE_页，共_PAGES_页",
                "infoEmpty": "No records available",
                "infoFiltered": "(filtered from _MAX_ total records)",
                "search": "搜索：",
                "paginate": {
                    "first": "首頁",
                    "last": "末頁",
                    "next": "下一頁",
                    "previous": "前一頁"
                },
            },
        });
    });
</script>
</body>
</html>
